package com.aishua.andpaydemo.utils;

import android.content.Context;
import android.support.annotation.ColorRes;
import android.util.Log;

import com.aishua.andpaydemo.ThemeHelper;

/**
 * Created by aishua on 2018/5/19.
 */

public class TableLayoutChangeColorUtils {


    private static String getTheme(Context context) {

        if (ThemeHelper.getTheme(context) == ThemeHelper.PURPLE) {
            return "purple";
        } else if (ThemeHelper.getTheme(context) == ThemeHelper.PINK) {
            return "pink";
        } else if (ThemeHelper.getTheme(context) == ThemeHelper.BLUE) {
            return "blue";
        } else if (ThemeHelper.getTheme(context) == ThemeHelper.GREEN) {
            return "green";
        } else if (ThemeHelper.getTheme(context) == ThemeHelper.RED) {
            return "red";
        } else if (ThemeHelper.getTheme(context) == ThemeHelper.YELLOW) {
            return "yellow";
        }
        return null;
    }


    public static @ColorRes int getThemeColorId(Context context ) {
         String theme = getTheme(context);
        return context.getResources().getIdentifier(theme, "color", context.getPackageName());
    }


}
